// ignore_for_file: prefer_interpolation_to_compose_strings


///文档注释
/// dart   行， 块 文档
void main(List<String> arguments) {
  /*
   *
   */
  //
  // test1();
  test2();
}

//操作符
void test1(){
  // String a;
  // print(a?.length); // null

  // String a="aaa";
  // print(a?.length); // 3
}

// 被除数 ÷ 除数 = 商 … 余数，A ~/ B = C，这个C就是商。相当于Java里的 /
void test2(){
  int a = 10;
  print((a ~/ 3)); //2
  print(a / 3); // 2.5
}


class Child {}
class Parent {}
void test3() {
  //as 类型转换
  num iNum = 1;
  num dNum = 1.0;
  int i = iNum as int;
  double d = dNum as double;
  print([i, d]); // [1, 1.0]

//  String s = iNum as String;

  //is 如果对象是指定的类型返回 True
  print(iNum is int); // false
  Child child;
  Child child1 = new Child();
  // print(child is Parent); // false //child is Null
  print(child1 is Parent); // false

  //is! 如果对象是指定的类型返回 False
  print(iNum is! int); // false
}


void test5(){
  StringBuffer sb = new StringBuffer();
  sb
    ..write('dongnao')
    ..write('flutter')
    ..write('\n')
    ..writeln('damon');
  print(sb);
}